package scau.erps.service.impl;

import java.util.List;

import org.nutz.service.IdNameEntityService;

import scau.erps.entity.Team;
import scau.erps.service.TeamService;

/**
 * 小组服务实现类
 * @author DCJ
 *
 */
public class TeamServiceImpl extends IdNameEntityService<Team> implements TeamService{

	/**
	 * 查询所有小组
	 * @return
	 */
	@Override
	public List<Team> getAllTeams() {
		return this.query(null, null);
	}
	/**
	 * 登陆校验
	 * @param teamName
	 * @param password
	 * @return
	 */
	@Override
	public boolean loginCheck(int id,String password) {
		boolean flag = false;
		Team team = this.fetch(id);
		if (password.equals(team.getPassword())) {
			flag = true;			
		}
		return flag;
	}
	/**
	 * 根据ID得到小组
	 * @param id
	 * @return
	 */
	@Override
	public Team getTeamById(int id) {
		return this.fetch(id);
	}

}
